//C14:14.7:funds3.c -- struct as argumet to transport.
#include <stdio.h>
#define FUNDLEN  50

struct funds
{
	char bank[FUNDLEN];
	double bankfund;
	char save[FUNDLEN];
	double savefund;
};

double sum(struct funds moolah);

int main(void)
{
	struct funds stan = 
	{
		"Garlic-Melon Bank",
		3024.72,
		"Lucky's Savings and Loan",
		9237.11
	};
	printf("Stan has a total of $%.2f.\n", sum(stan));
}

double sum(struct funds moolah)
{
	return moolah.bankfund + moolah.savefund;
}

